package com.bdqn.config;

import com.bdqn.interceptor.AuthorizationInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


// @Configuration
public class InterceptorConfig implements WebMvcConfigurer {

    String[] pathPatterns = {"/**"}; // 拦截路径规则
    String[] excludePathPatterns = {"/login", "/api/**", "/static/**", "/css/**", "/js/**", "/fonts/**", "/images/**", "/localcss/**", "/localjs/**", "/druid/**"}; // 排除路径规则

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new AuthorizationInterceptor()).addPathPatterns(pathPatterns).excludePathPatterns(excludePathPatterns);
    }

}
